package com.ssh.manager.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.ssh.dao.IDao;
import com.ssh.entity.Admin;
import com.ssh.manager.AdminManager;

@Service
public class AdminManagerImpl implements AdminManager {
	@Resource
	private IDao daoImpl;

	@Override
	public Admin adminLogin(String userName, String userPwd) {
		String sql = "from Admin where userName=? and password=? and del!=1";
		List<Admin> admins = (List<Admin>)daoImpl.findListBySql(sql, new Object[]{userName, userPwd}, false, true, false, 0, 1);
		if (admins.size()>0) return admins.get(0);
		return null;
	}
}
